package main

import (
	"log"
	"net/http"
	"time"

	"golang.org/x/net/http2"
)

const idleTimeout = 5 * time.Minute
const activeTimeout = 10 * time.Minute

func main() {
	srv := http.Server{
		Addr: ":8080",
	}
	//http2.VerboseLogs = true
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("hello http2"))
	})
	// srv 作为服务器  第二个参数未config
	http2.ConfigureServer(&srv, &http2.Server{})
	log.Fatal(srv.ListenAndServeTLS("/home/zhang/workspace/learning/server.crt", "/home/zhang/workspace/learning/server.key"))
}
